from selenium import webdriver
from log import logger
from selenium.common.exceptions import NoSuchElementException
from config import Config

options = webdriver.FirefoxOptions()
options.add_argument('-headless')
profile_dir = Config().get('Profile')
profile = webdriver.FirefoxProfile(profile_dir)  
driver = webdriver.Firefox(firefox_options=options,firefox_profile=profile)
driver.get('http://www.11ziyun.com')
driver.maximize_window()
js = 'window.scrollTo(0,220);'
driver.execute_script(js)
driver.get_screenshot_as_file('D:\\Test_ZY_framework\\log\\test.png')

for category in driver.find_elements_by_class_name('cat-parent'):
    print(category.text)

